<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name='viewport' content='width=device-width, initial-scale=1.0'>
        <title>Title</title>
    </head>
    <body>
        <div id="app">
            <router-link to="/">首页</router-link>
            <router-link to="/about">关于我们</router-link>
            <router-view></router-view>
        </div>
        <script src="./js/vue.js"></script>
        <script src="./js/vue-router.js"></script>
        <script>
            let home = {
                template: `<div>我是首页</div>`
            }
            let about = {
                template: `<div>我是关于我们</div>`
            }
            let routes = [
                {"path": "/", component: home},
                {"path": "/about", component: about},
            ];
            let router = new VueRouter({
                routes
            })

            new Vue({
                el: '#app',
                data: {},
                router
            });
        </script>
    </body>
</html>